﻿{% extends "base_generic.html" %}

{% block title %}VizSpread{% endblock %}

{% block header %}
	{{ header }}
{% endblock header %}

{% block content %}

	{% if errormessage %}
	<p class="error">{{ errormessage }}</p>
	{% endif %}

	{% ifnotequal datasetCount 0 %}
	<div id="datasets">
		<h2>Saved Data Sets</h2>
		<form name="loadset" action="/map" method="post"> 
			<p>Select a set:</p>
			{% for set in datasets %}
			<div> 
				<label for="dataset_{{ set.name }}">{{ set.name }}</label>
				<input type="radio" id="dataset_{{ set.name }}" name="{{ set.name }}" value="{{ set.name }}" /> 
				<span>{{ set.sessionId }}</span>
			</div> 
			{% endfor %}
			<div> 
				<input type="hidden" name="datasettype" value="load"> 
				<input type="submit" name="submit" value="Load"> 
			</div> 
		</form> 
			{{ sets }}
	</div>
	{% endifnotequal %}

	<h2>Create a new data set</h2>
	<form name="createset" action="/map" method="post" enctype="multipart/form-data"> 
		<div> 
			<label for="datasetname">Data Set Name:</label>
			<input type="text" name="datasetname" id="datasetname" /> 
		</div> 
		<div> 
			<label for="mapcentre">Centre:</label>
			<input type="text" name="mapcentre" id="mapcentre" /> 
		</div> 
		<div> 
			<label for="contactsfile">Contacts File:</label>
			<input type="file" name="contactsfile" id="contactsfile" /> 
		</div> 
		<div> 
			<input type="hidden" name="datasettype" value="new"> 
			<input type="submit" value="Show spread"> 
		</div> 
	</form> 
{% endblock content %}
